package com.lagou.service.impl;

import com.lagou.dao.AccountDao;
import com.lagou.service.AccountService;
import com.lagou.utils.TransactionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service("accountService")
public class AccountServiceImpl implements AccountService {

    @Autowired
    @Qualifier("accountDao")
    private AccountDao accountDao;
    @Autowired
    private TransactionManager manager;

    // 转账方法 切入点
    public void transfer(String outUser, String inUser, Double money) {

        System.out.println("目标类");
        // int i = 1/0;
        // 借出
        accountDao.out(outUser,money);
        // 借进
        accountDao.in(inUser,money);

    }
}
